<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<jsp:include page="/inc/header.jsp"/>
<script type="text/javascript" src="js/ui.datepicker.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		// 渲染portlet
		$(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
			.find(".portlet-header")
				.addClass("ui-widget-header ui-corner-top")
				.prepend('<span class="ui-icon ui-icon-triangle-1-n"></span>')
				.end()
			.find(".portlet-content");
		// 加入折叠
		$(".portlet-header .ui-icon").click(function() {
			$(this).parents(".portlet:first").find(".portlet-content").slideToggle("fast");
			$(this).toggleClass("ui-icon-triangle-1-s"); 
			return false;	
		});
		$(".pagination").page();
	});
	function page(p) {
		$("#pageSize").val(p);
		$("#pageSubmit").submit();
	}
</script>
<div class="grid_16" id="content">
	<!--  模块标题  -->
	<div class="grid_9">
		<h1 class="dashboard">角色管理</h1>
	</div>
	<!-- 模块事件提示(按情况使用)是个日历 -->
	<div class="grid_6" id="eventbox">
		<a href="#" class="inline_calendar">
			添加角色
		</a>
	</div>
	<div class="clear"></div>
	<!-- portlets -->
	<div id="portlets">
		<div class="clear"></div>
		<!-- portlet容器 -->
		<div class="portlet">
			<div class="portlet-header fixed">
				<img src="images/icons/user.gif" width="16" height="16" alt="Latest Registered Users" />角色列表
			</div>
			<div class="portlet-content nopadding">
				<form action="roleList.do" method="post" id="pageSubmit">
					<!-- 表格 -->
					<table width="100%" cellpadding="0" cellspacing="0"
						id="box-table-a" summary="Employee Pay Sheet">
						<thead>
							<tr>
								<th width="34" scope="col">
									<input type="checkbox" name="allbox" id="allbox"/>
								</th>
								<th width="136" scope="col">序号</th>
								<th width="102" scope="col">角色编号</th>
								<th width="109" scope="col">角色名称</th>
								<th width="129" scope="col">角色描述</th>
								<th width="90" scope="col">操作</th>
							</tr>
						</thead>
						<tbody>
							<s:if test="roleList.size > 0">
								<s:set id="count" value="(roles.page - 1) * 10"/>
								<s:iterator id="role" value="roleList">
									<s:set id="count" value="#count+1"/>
									<tr>
										<td width="34">
											<label><input type="checkbox" name="checkbox" id="checkbox" /></label>
										</td>
										<td><s:property value="#count"/></td>
										<td><s:property value="#role.role_code"/></td>
										<td><s:property value="#role.role_name"/></td>
										<td><s:property value="#role.role_desc"/></td>
										<td width="90">
											<a href="#" class="approve_icon" title="Approve"></a>
											<a href="#" class="reject_icon" title="Reject"></a>
											<a href="#" class="edit_icon" title="Edit"></a>
											<a href="#" class="delete_icon" title="Delete"></a>
										</td>
									</tr>
								</s:iterator>
							</s:if>
							<s:else>
								<tr height="90">
									<td width="34" colspan="6" align="center" valign="middle">
										没有数据
									</td>
								</tr>
							</s:else>
							<!-- 分页 -->
							<tr class="footer">
								<td colspan="2">
									<!-- 操作 -->
									<a href="#" class="edit_inline">Edit all</a>
									<a href="#" class="delete_inline">Delete all</a>
									<a href="#" class="approve_inline">Approve all</a>
									<a href="#" class="reject_inline">Reject all</a>
								</td>
								<td align="right">&nbsp;</td>
								<td colspan="3" align="right">
									<input type="hidden" name="page" id="pageSize" value="<s:property value="roles.page"/>"/>
									<input type="hidden" name="selectedFirst" value="<s:property value="#request.selectedFirst"/>"/>
									<input type="hidden" name="selectedSecond" value="<s:property value="#request.selectedSecond"/>"/>
									<!-- 分页信息 -->
									<div class="pagination" page="<s:property value="roles.page"/>" totalLine="<s:property value="roles.totalLine"/>">
									<!--  
										<span class="previous-off">&laquo; Previous</span> 
										<span class="active">1</span> 
										<a href="dashboard.html-page=2.htm">2</a>
										<a href="dashboard.html-page=3.htm">3</a>
										<a href="dashboard.html-page=4.htm">4</a>
										<a href="dashboard.html-page=5.htm">5</a>
										<a href="dashboard.html-page=6.htm">6</a>
										<a href="dashboard.html-page=7.htm">7</a>
										<a href="dashboard.html-page=2.htm"class="next">Next &raquo;</a>
									-->
									</div>
								</td>
							</tr>
						</tbody>
					</table>
				</form>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<jsp:include page="/inc/footer.jsp"/>